using System;
using Microsoft.Scripting;

namespace Nua.Compiler
{
	// A lexical token. Extracted from program text by the scanner and consumed
	// by the parser.
	public struct Token
	{
		// Design note: It is possible to use polymorphism and introduce a
		// small number of classes, e.g. abstract class Token, class
		// Identifier : Token, etc.

        public Token(TokenKind kind, SourceSpan span, object value)
        {
            this.Kind = kind;
            this.Value = value;
            this.Span = span;
        }

		public readonly TokenKind Kind;		// See TokenKind
        public readonly SourceSpan Span;
		public readonly object Value;			// Value from source text
	}
}
